package com.example.pulseanalyse;

/**
 * @author: yyw
 * time: 2020/12/2 14:40
 * desc:张帅SO文件JNI接口类（发送点和获取分析结果）
 */
public class PulseAnalyse {

    public class PulseInfo {

        private int begin;
        private int end;
        private int pRate;
        private int[] data;


        public void setData(int[] datain) {
            this.data = datain;
        }

        public int[] getData() {
            return data;
        }

        public int getBegin() {
            return begin;
        }

        public void setBegin(int begin) {
            this.begin = begin;
        }

        public int getEnd() {
            return end;
        }

        public void setEnd(int end) {
            this.end = end;
        }

        public int getpRate() {
            return pRate;
        }

        public void setpRate(int pRate) {
            this.pRate = pRate;
        }

    }

    public static final int SUCCESS = 0;

    public native int setDataToJNI(int data);

    public native int getResultFromJNI(PulseInfo pulseInfo);

    public native void interruptPulseAnalyseJNI();

    public native int ManualAnalysisJNI(int[] in_data, PulseInfo pulseInfo);

    static {
        System.loadLibrary("native-lib");
//        System.loadLibrary("periodic_pulse");
    }
}